#include "ArduinoMg995ServoTestHardwareInfo.h"
#include <Servo.h>

HardwareSerial* serial;
Servo* servo;

void setup() 
{
	using namespace ArduinoMg995ServoTestHardwareInfo;
	
	serial = &Serial;
	serial->begin(HARDWARE_SERIAL_BAUDRATE);

	servo = new Servo();
	servo->attach(SERVO_PWM);

	servo->write(90);
}

void loop() 
{
	if (serial->available())
	{
		auto input = serial->readString();
		auto value = input.toInt();
		servo->write(value);
	}
}
